package net.bolue.sysmng.tblbean;

import java.util.Iterator;
import java.util.Map;
import java.util.Set;

/**
 * MVC基本配置
 * @author Administrator
 *
 */
public class MvcAction extends TableBean{

	/**
	 * 子系统
	 */
	private String subsys;
	
	/**
	 * 动作标识
	 */
	private String actId;
	
	/**
	 * 动作描述
	 */
	private String actDesc;
	
	/**
	 * 处理动作类名
	 */
	private String actClass;
	
	/**
	 * action方式
	 * 1：redirect
	 * 3:ajax
	 */
	private Integer actionType;
	
	/**
	 * 是否自动返回
	 */
	private Integer isAutoBack;
	
	/**
	 * 是否redirect
	 */
	private Integer isRedirect;
	
	/**
	 * URL路径
	 */
	private String urlPath;
	
	/**
	 * URL描述
	 */
	private String urlDesc;
	
	/**
	 * 备注
	 */
	private String remark;
	
	public String getSubsys() {
		return subsys;
	}

	public void setSubsys(String subsys) {
		this.subsys = subsys;
	}

	public String getActId() {
		return actId;
	}

	public void setActId(String actId) {
		this.actId = actId;
	}

	public String getActDesc() {
		return actDesc;
	}

	public void setActDesc(String actDesc) {
		this.actDesc = actDesc;
	}

	public String getActClass() {
		return actClass;
	}

	public void setActClass(String actClass) {
		this.actClass = actClass;
	}

	public Integer getIsAutoBack() {
		return isAutoBack;
	}

	public void setIsAutoBack(Integer isAutoBack) {
		this.isAutoBack = isAutoBack;
	}

	public Integer getActionType() {
		return actionType;
	}

	public void setActionType(Integer actionType) {
		this.actionType = actionType;
	}

	public Integer getIsRedirect() {
		return isRedirect;
	}

	public void setIsRedirect(Integer isRedirect) {
		this.isRedirect = isRedirect;
	}

	public String getUrlPath() {
		return urlPath;
	}

	public void setUrlPath(String urlPath) {
		this.urlPath = urlPath;
	}

	public String getUrlDesc() {
		return urlDesc;
	}

	public void setUrlDesc(String urlDesc) {
		this.urlDesc = urlDesc;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Override
	public TableBean mapToEntry(Map<String, Object> map) {
		MvcAction mvcAction = new MvcAction();
		Set<String> keySet = map.keySet();
		Iterator<String> keyIt = keySet.iterator();
		while(keyIt.hasNext()){
			String key = keyIt.next();
			Object o = map.get(key);
			if("SUBSYS".equals(key)){
				mvcAction.setSubsys((String)o);
			} else if("ACTID".equals(key)){
				mvcAction.setActId((String)o);
			} else if("ACTDESC".equals(key)){
				mvcAction.setActDesc((String)o);
			} else if("ACTCLASS".equals(key)){
				mvcAction.setActClass((String)o);
			} else if("ISAUTOBACK".equals(key)){
				mvcAction.setIsAutoBack((Integer)o);
			} else if("ACTIONTYPE".equals(key)){
				mvcAction.setActionType((Integer)o);
			} else if("ISREDIRECT".equals(key)){
				mvcAction.setIsRedirect((Integer)o);
			} else if("URLPATH".equals(key)){
				mvcAction.setUrlPath((String)o);
			} else if("URLDESC".equals(key)){
				mvcAction.setUrlDesc((String)o);
			} else if("REMARK".equals(key)){
				mvcAction.setRemark((String)o);
			}
		}
		return mvcAction;
	}

	@Override
	public String keyProps() {
		return "SUBSYS,ACTID";
	}

}
